package com.lpit.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 广告表
 * @TableName advertising
 */
@TableName(value ="advertising")
@Data
public class Advertising implements Serializable {
    /**
     * 广告表id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 广告标题
     */
    private String advertisingTitle;

    /**
     * 广告图片
     */
    private String img;

    /**
     * 广告来源
     */
    private String source;

    /**
     * 广告行业
     */
    private String industry;

    /**
     * 资质证明文件
     */
    private String qualificationCertificate;

    /**
     * 广告跳转链接
     */
    private String jumpLink;

    /**
     * 广告发布时间
     */
    private Date startTime;

    /**
     * 广告状态(审核)
     */
    private String status;

    /**
     * 用户id
     */
    private Integer userId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Advertising other = (Advertising) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getAdvertisingTitle() == null ? other.getAdvertisingTitle() == null : this.getAdvertisingTitle().equals(other.getAdvertisingTitle()))
            && (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg()))
            && (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource()))
            && (this.getIndustry() == null ? other.getIndustry() == null : this.getIndustry().equals(other.getIndustry()))
            && (this.getQualificationCertificate() == null ? other.getQualificationCertificate() == null : this.getQualificationCertificate().equals(other.getQualificationCertificate()))
            && (this.getJumpLink() == null ? other.getJumpLink() == null : this.getJumpLink().equals(other.getJumpLink()))
            && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getAdvertisingTitle() == null) ? 0 : getAdvertisingTitle().hashCode());
        result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode());
        result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode());
        result = prime * result + ((getIndustry() == null) ? 0 : getIndustry().hashCode());
        result = prime * result + ((getQualificationCertificate() == null) ? 0 : getQualificationCertificate().hashCode());
        result = prime * result + ((getJumpLink() == null) ? 0 : getJumpLink().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", advertisingTitle=").append(advertisingTitle);
        sb.append(", img=").append(img);
        sb.append(", source=").append(source);
        sb.append(", industry=").append(industry);
        sb.append(", qualificationCertificate=").append(qualificationCertificate);
        sb.append(", jumpLink=").append(jumpLink);
        sb.append(", startTime=").append(startTime);
        sb.append(", status=").append(status);
        sb.append(", userId=").append(userId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}